package com.github.winyiwin.archetypes.api.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author: secoo
 * @date: 2020/6/4 12:40
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultDTO<T> implements Serializable {

    private Boolean success;
    private Integer code;
    private String message;
    private T data;

    public static <T> ResultDTO success(Integer code, String message, T data) {
        return new ResultDTO(true, code, message, data);
    }

    public static <T> ResultDTO success(T data) {
        return new ResultDTO(true, 10000, "SUCCESS", data);
    }


}
